InvalidCastException is thrown when importing a document with a structure element with an indirect reference to an integer value.
InvalidCastException: 'Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfInt' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.MarkedContents.StructElementObject'.'
<w:sdt>
<w:sdtPr>
<w:text w:multiLine="1"/>
</w:sdtPr>
<w:sdtContent>
<w:r>
<w:t>Line 1</w:t>
</w:r>
<w:r>
<w:br/>
</w:r>
<w:r>
<w:t>Line 2</w:t>
</w:r>
</w:sdtContent>
</w:sdt>
Registering the font used to be enough for resolving the font's characters in .NET Standard
byte[] fontData = File.ReadAllBytes(".\\files\\cour.ttf");
FontFamily courierNewFont = new FontFamily("Courier New");
FontsRepository.RegisterFont(courierNewFont, FontStyles.Normal, FontWeights.Normal, fontData);
However, as of version 2024.2.426 registering the font doesn't produce the correct result anymore and the text got missing in the PDF fields. When the document is opened in Adobe, the following message appears:
The FontsProvider works in both versions (before and after 2024.2.426). It is also required to iterate all widgets and apply the font explicitly to the widget.TextProperties.Font property.
Import/export strips w:colFirst and w:colLast from table's <w:permStart> elements.
Expected:
Actual: